package com.ty.xiaoyu.service.impl;

import com.ty.xiaoyu.entity.NotifyModule;
import com.ty.xiaoyu.service.NotifyModuleService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NotifyModuleServiceImpl extends BaseService implements NotifyModuleService {

    @Override
    public List<NotifyModule> getNotifyModuleList(String userId) {
        List<NotifyModule> notifyModuleList = notifyModuleMapper.queryNotifyModuleList();
        for (NotifyModule notifyModule : notifyModuleList) {
            Integer notifyCount = notifyMapper.queryNotifyCount(userId, notifyModule.getNotifyModuleId());
            notifyModule.setNotifyNum(notifyCount);
        }
        return notifyModuleList;
    }
}
